#include <iostream>
#include <string>
using namespace std;

//class A
//{
//public:
//	void print()
//	{
//		cout << _a << endl;
//	}
//protected:
//	int _a = 1;
//};
//
//
//class B :public A
//{
//public:
//	void print()
//	{
//		cout << _b << endl;
//		cout << _a;
//		//A::print();
//	}
//protected:
//	int _b = 2;
//
//};



class Person
{
public:
	/*Person(string name = "jack",string sex = "man",int age = 10)
		:_name(name)
		,_sex(sex)
		,_age(age)
	{}*/


	Person(string name, string sex, int age )
		:_name(name)
		, _sex(sex)
		, _age(age)
	{
		cout << "Person(string name, string sex, int age )" << endl;
	}

	Person(const Person& per)
	{
		_name = per._name;
		_sex = per._sex;
		_age = per._age;

		cout << "Person(const Person& per)" << endl;
	}

	Person& operator=(const Person& per)
	{
		cout << "Person& operator=(const Person& per)" << endl;
		if (this != &per)
		{
			_name = per._name;
			_sex = per._sex;
			_age = per._age;
		}
		return *this;
	}
	void Print()
	{
		cout << _name << " " << _sex << " " << _age << endl;
	}

	~Person()
	{
		cout << "~Person()" << endl;
	}
protected:
	string _name;
	string _sex;
	int _age;
};


class Student:public Person
{
public:
	Student(int non = 1)
		:_non(non)
		, Person("jack", "amn", 11)
	{
		cout << "Student(int non = 1)" << endl;
	}

	Student(const Student& stu)
		:Person(stu)
		,_non(stu._non)
	{
		cout << "Student(const Student& stu)" << endl;
	}
	void Print()
	{
		cout << _name << " " << _sex << " " << _age << " "<<_non << endl;
	}

	Student& operator=(const Student& stu)
	{
		cout << "Student& operator=(const Student& stu)" << endl;
		if (this != &stu)
		{
			Person::operator=(stu);
			_non = stu._non;
		}
		return *this;
	}

	~Student()
	{
		cout << "~Student()" << endl;
	}
protected:
	int _non;
};







//class A
//{
//public:
//	int _a;
//};
//
//
//class B :public A
//{
//public:
//	int _b;
//};
//
//class C :public A
//{
//public:
//	int _c;
//};
//
//class D :public B, public C 
//{
//public:
//	int _d;
//};



class A
{
public:
	int _a;
};


class B :virtual public A
{
public:
	int _b;
};

class C :virtual public A
{
public:
	int _c;
};

class D :public B, public C
{
public:
	int _d;
};
void test1()
{
	/*Person p;
	p.Print();*/

	Student stu1;
	////stu.Print();
	//cout << endl;
	//Student stu1(stu);
	//cout << endl;
	Student stu2;
	stu2 = stu1;

	
}

void test2()
{
	/*D d;
	d.B::_a = 1;
	d.C::_a = 2;
	d._b = 3;
	d._c = 4;
	d._d = 5;*/

	D d;
	d._a = 1;
	d._b = 2;
	d._c = 3;
	d._d = 4;



}

int main()
{
	//Student stu1;
	//Person p1;

	//p1 = stu1;
	///*int i = 0;
	//double d = 1.1;
	//double& ref  = i;*/

	//Person& pp = stu1;
	//test1();
	test2();
}